import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home'
import Question from '@/views/question'
import Video from '@/views/video'
import User from '@/views/user'
import Layout from '@/views/layout'
import Article from '@/views/article'
import Login from '@/views/login'
import Register from '@/views/register'

Vue.use(VueRouter)

// const Tabbar = () => ('@/components/app-tabbar.vue')
// const Home = () => ('@/views/home')
const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: '/question', component: Question },
      { path: '/video', component: Video },
      { path: '/user', component: User },
      { path: '/home', component: Home }
    ]
  },
  {
    path: '/article',
    component: Article
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  }

]

const router = new VueRouter({
  routes
})

export default router
